package com.offcn.item.service.controller;

import com.offcn.entity.Result;
import com.offcn.entity.StatusCode;
import com.offcn.item.service.PageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @author ld
 * @date 2021/9/17 16:35
 */
@Controller
@RequestMapping("/page")
public class PageController {

    @Autowired
    private PageService pageService;
    /**
     * 生成静态页面
     * @param skuId
     * @return
     */
    @GetMapping("/create/{skuId}")
    public Result createPageHtml(@PathVariable Long skuId) {
        pageService.createPageHtml(skuId);
        return new Result(true, StatusCode.OK, "生成成功");
    }
}
